find_package(Qt4 REQUIRED QtCore QtGui)

set(qdock_SOURCES
qdock.cpp
dockwidget.cpp
previewer.cpp
basedock.cpp
docklayouts.cpp
dockmanager.cpp
layoutmanager.cpp
../defaultwindowfinder.cpp
containers.cpp
indicators.cpp
imitatorwidget.cpp
policymanager.cpp
splitter.cpp
tabbedcontainer.cpp
)

set(qdock_HEADERS
qdock.h
dockwidget.h
dockmanager.h
layoutmanager.h
containers.h
indicators.h
imitatorwidget.h
previewer.h
basedock.h
policymanager.h
splitter.h
tabbedcontainer.h
)

qt4_wrap_cpp(qdock_SOURCES_MOC ${qdock_HEADERS} )

add_library(qdock SHARED ${qdock_SOURCES} ${qdock_SOURCES_MOC})
set(qdock_LIBRARIES ${QT_LIBRARIES} )
target_link_libraries(qdock ${qdock_LIBRARIES})

subdirs(sample)

if (ENABLE_TESTING)

    set(qdocktest_SOURCES tests/qdocktest.cpp)
    set(qdocktest_HEADERS tests/qdocktest.h)

    qt4_wrap_cpp(qdocktest_SOURCES_MOC ${qdocktest_HEADERS})
    add_executable(qdocktest ${qdocktest_SOURCES_MOC} ${qdocktest_SOURCES})
    target_link_libraries(qdocktest ${QT_QTTEST_LIBRARY} ${QT_LIBRARIES} ${qdock_LIBRARIES} qdock )

    add_test(NAME qdocktest COMMAND qdocktest)
endif()
